<?php

namespace App\Console\Commands;

use App\Services\BalanceService;
use App\Services\SipService;
use Illuminate\Console\Command;

class SyncSipbalance extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $balanceService;
    protected $signature = 'console:sync-sip-balance';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '同步SIP账号余额';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct(BalanceService $balanceService)
    {
        parent::__construct();
        $this->balanceService = $balanceService;
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->balanceService->syncBalance();
        $this->info("同步余额成功！");
    }
}
